package priv.yiyuan.example.design.pay;

import java.util.Map;

/**
 * 支付宝支付处理类
 * <p>
 * 接口部分 实现类
 */
public class AliPayProcessor implements PaymentProcessor {

    @Override
    public boolean processPayment(double amount, Map<String, String> paymentDetails) {

        System.out.println(
                String.format("支付宝支付: 金额 %.2f, 支付宝账号 %s\n",
                        amount, paymentDetails.get("aliPayAccount"))
        );

        return true;
    }

    @Override
    public boolean refund(double amount, String transactionId) {

        System.out.println(String.format("支付宝退款: 金额 %.2f, 交易ID %s\n", amount, transactionId));

        return true;
    }
}
